package pipixia

import (
	"github.com/gin-gonic/gin"
	"mz_water/entity"
	"mz_water/util"
	"net/http"
)

func GetPiPiXia(c *gin.Context)  {
	res := entity.Result{}
	res.SetCode(200)
	query := "https://h5.pipix.com/s/hukXsy/"
	_, header , err := util.HttpRequest(query)
	if err != nil {

	}
	urls := header.Get("location")
	items := util.GetItemId("item/([0-9]+)", urls)

	itemsUrl := "https://h5.pipix.com/bds/webapi/item/detail/"+items

	body, _ , err := util.HttpRequest(itemsUrl)
	if err != nil {

	}
	res.SetData(string(body))
	res.SetMessage("记录用户成功")
	c.JSON(http.StatusOK, res)
}
